Imports StartFrame.BR.Interfaces


Public Class UsrSistemaDemo
    Inherits StartFrame.US.Dialogo

#Region "Declaraciones"

    Dim _UsrSistemaDemo As IUsrSistemaDemo
    Dim ds As New DataSet

#End Region

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents LnkGrid1 As LnkGrid
    Friend WithEvents Timer1 As System.Windows.Forms.Timer
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(UsrSistemaDemo))
        Me.LnkGrid1 = New LnkGrid
        Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
        Me.TabPage1.SuspendLayout()
        CType(Me.LnkGrid1, System.ComponentModel.ISupportInitialize).BeginInit()
        '
        'cmdSalir
        '
        Me.cmdSalir.Image = CType(resources.GetObject("cmdSalir.Image"), System.Drawing.Image)
        Me.cmdSalir.Name = "cmdSalir"
        '
        'cmdConfirmar
        '
        Me.cmdConfirmar.Image = CType(resources.GetObject("cmdConfirmar.Image"), System.Drawing.Image)
        Me.cmdConfirmar.Name = "cmdConfirmar"
        '
        'lblTitulo
        '
        Me.lblTitulo.Name = "lblTitulo"
        Me.lblTitulo.Text = "Usuarios Conectados al Sistema"
        '
        'cmdCancelar
        '
        Me.cmdCancelar.Image = CType(resources.GetObject("cmdCancelar.Image"), System.Drawing.Image)
        Me.cmdCancelar.Name = "cmdCancelar"
        '
        'PictureBox1
        '
        Me.PictureBox1.BackgroundImage = CType(resources.GetObject("PictureBox1.BackgroundImage"), System.Drawing.Image)
        Me.PictureBox1.Name = "PictureBox1"
        '
        'cmdMinimizar
        '
        Me.cmdMinimizar.Image = CType(resources.GetObject("cmdMinimizar.Image"), System.Drawing.Image)
        Me.cmdMinimizar.Name = "cmdMinimizar"
        '
        'LnkTab1
        '
        Me.LnkTab1.Name = "LnkTab1"
        '
        'PictureBox2
        '
        Me.PictureBox2.BackgroundImage = CType(resources.GetObject("PictureBox2.BackgroundImage"), System.Drawing.Image)
        Me.PictureBox2.Name = "PictureBox2"
        '
        'TabPage1
        '
        Me.TabPage1.Controls.Add(Me.LnkGrid1)
        Me.TabPage1.DockPadding.All = 8
        Me.TabPage1.Name = "TabPage1"
        '
        'PictureBox3
        '
        Me.PictureBox3.BackgroundImage = CType(resources.GetObject("PictureBox3.BackgroundImage"), System.Drawing.Image)
        Me.PictureBox3.Name = "PictureBox3"
        '
        'LnkGrid1
        '
        Me.LnkGrid1.CaptionText = "Usuarios Actualmente Conectados al Sistema"
        Me.LnkGrid1.DataMember = ""
        Me.LnkGrid1.Font = New System.Drawing.Font("Tahoma", 8.0!)
        Me.LnkGrid1.HeaderFont = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Bold)
        Me.LnkGrid1.Location = New System.Drawing.Point(16, 16)
        Me.LnkGrid1.Name = "LnkGrid1"
        Me.LnkGrid1.ReadOnly = True
        Me.LnkGrid1.Size = New System.Drawing.Size(480, 216)
        Me.LnkGrid1.TabIndex = 0
        '
        'Timer1
        '
        Me.Timer1.Interval = 30000
        '
        'UsrSistemaDemo
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.BackgroundImage = CType(resources.GetObject("$this.BackgroundImage"), System.Drawing.Image)
        Me.ClientSize = New System.Drawing.Size(524, 403)
        Me.Name = "UsrSistema"
        Me.TabPage1.ResumeLayout(False)
        CType(Me.LnkGrid1, System.ComponentModel.ISupportInitialize).EndInit()

    End Sub

#End Region

#Region "Eventos"

    'Al cargar el formulario
    'RV: OV, 21/02/2005
    Private Sub UsrSistema_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Try
            'Reglas del negocio
            _UsrSistemaDemo = CType(RemotingHelper.getObject(GetType(IUsrSistemaDemo)), IUsrSistemaDemo)
            Me.ObjetoReglasNegocio = CType(_UsrSistemaDemo, IUsrSistemaDemo)

            'Busca los usuarios
            ds = _UsrSistemaDemo.UsuariosConectados()

            'Refresca la grilla
            Me.LnkGrid1.SetDataBinding(ds, "UsrSistema")

            'Timer
            Me.Timer1.Enabled = True

        Catch ex As Exception
            StartFrame.US.Display.ShowError(ex.Message)
        End Try

    End Sub

    'Al presionar Confirmar
    'RV: OV, 21/02/2005
    Public Overrides Sub cmdConfirmar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdConfirmar.Click

        'Apaga el timer
        Me.Timer1.Enabled = False
        'Busca los usuarios
        ds = _UsrSistemaDemo.UsuariosConectados()
        'Refresca la grilla
        Me.LnkGrid1.SetDataBinding(ds, "UsrSistema")
        'Reactiva el timer
        Me.Timer1.Enabled = True

    End Sub

    'Al presionar Cancelar
    'RV: OV, 21/02/2005
    Public Overrides Sub cmdCancelar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCancelar.Click
        Me.Close()
    End Sub

    'Al dispararse el timer (cada 30 segundos)
    'RV: OV, 21/02/2005
    Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick

        'Busca los usuarios
        ds = _UsrSistemaDemo.UsuariosConectados()

        'Refresca la grilla
        Me.LnkGrid1.SetDataBinding(ds, "UsrSistema")

    End Sub

#End Region

End Class

